/*
 * Copyright 2023-2025 Licensed under the Dual Licensing
 * website: https://aizuda.com
 */
package com.aizuda.bpm.engine.scheduling;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * 提醒参数
 *
 * <p>
 * <a href="https://aizuda.com">官网</a>尊重知识产权，不允许非法使用，后果自负
 * </p>
 *
 * @author hubin
 * @since 1.0
 */
@Getter
@Setter
public class RemindParam {
    /**
     * 提醒时间 cron 表达式
     */
    private String cron;
    /**
     * 工作日设置，格式为 1,2,3...7，表示周一至周日
     */
    private String weeks;
    /**
     * 工作时间设置，格式为 8:00-18:00
     */
    private String workTime;

    /**
     * 消息配置
     */
    private MessageConfig message = new MessageConfig();

    /**
     * 提醒时间配置
     */
    private TimingConfig timing = new TimingConfig();

    /**
     * 任务超时配置
     */
    private TimeoutConfig timeout = new TimeoutConfig();

    @Data
    public static class MessageConfig {

        private String title = "任务超时待处理";

        private String contentTemplate = "{sponsor}发起的{flowType}【{contractName}】已经流转到【{nodeName}】,该任务已超过【{timeoutHours}】小时尚未处理,请尽快处理";

        private String businessType = "flowTodoTask";
    }

    @Data
    public static class TimingConfig {

        private Long nextReminderIntervalSeconds = 2 * 60 * 60L;

    }

    @Data
    public static class TimeoutConfig {

        private Integer timeoutHours = 24;

        private Boolean enableDynamicTimeout = true;
    }

}
